Skip to content

refactor(supervisor): pass agent proposal state explicitly - #2421

Merged
SDAChess merged 2 commits into
mainfrom
refactor-agent-proposals-state
Jul 24, 2026
Merged

refactor(supervisor): pass agent proposal state explicitly#2421
SDAChess merged 2 commits into
mainfrom
refactor-agent-proposals-state

Conversation

@elezar

@elezar elezar commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

Replace the process-global agent policy proposal flag with explicit shared AgentProposals state threaded through sandbox, process, and network supervisor runtime paths. This removes downstream dev-dependencies on openshell-core/test-helpers and keeps tests from relying on Cargo feature unification.

Related Issue

N/A

Changes

  • Add explicit AgentProposals shared state in openshell-core and remove the test-helpers feature.
  • Seed proposal state from the initial sandbox settings snapshot and update it from the policy poll loop.
  • Pass proposal state into process setup, policy.local, proxy/L7 evaluation, and deny response rendering.
  • Add a test-only default for L7EvalContext so tests remain compact as context fields grow.
  • Update proposal-related tests to use explicit state instead of a global guard.

Testing

  • mise run pre-commit passes (not run)
  • Unit tests added/updated
  • E2E tests added/updated (not applicable)

Additional checks run:

  • nix develop --command cargo fmt --check
  • nix develop --command cargo check -p openshell-supervisor-network -p openshell-sandbox -p openshell-supervisor-process -p openshell-core --tests
  • nix develop --command cargo test -p openshell-supervisor-network policy_local::tests -- --nocapture
  • nix develop --command cargo test -p openshell-supervisor-network deny_response_body -- --nocapture
  • nix develop --command cargo test -p openshell-supervisor-network send_deny_response_writes_structured_json_403 -- --nocapture
  • nix develop --command cargo test -p openshell-supervisor-network middleware_ -- --nocapture
  • nix develop --command cargo test -p openshell-sandbox agent_proposals_setting -- --nocapture

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (not applicable)

@copy-pr-bot

copy-pr-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@elezar elezar added the test:e2e Requires end-to-end coverage label Jul 22, 2026
@github-actions

Copy link
Copy Markdown

Label test:e2e applied, but pull-request/2421 does not exist yet. A maintainer needs to comment /ok to test ef5b7a73a2ee131bd78793777739dfd9ad4c6856 to mirror this PR. Once the mirror exists, re-apply the label or re-run Branch E2E Checks from the Actions tab.

@elezar elezar added the gator:blocked Gator is blocked by process or repository gates label Jul 22, 2026
@elezar

elezar commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

gator-agent

Blocked

Head SHA: ef5b7a73a2ee131bd78793777739dfd9ad4c6856

Gator is blocked because this PR is still marked as a draft, so the code review workflow should not run yet.

Next action: @elezar, mark the PR ready for review when it is ready for gator to run the independent code review and continue CI monitoring.

@elezar
elezar marked this pull request as ready for review July 23, 2026 08:48

@elezar elezar left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

PR Review Status

Validation: This maintainer-authored refactor is project-valid for OpenShell because it is concentrated in the sandbox/supervisor policy-proposal state path and removes test coupling on a process-global Cargo feature.
Head SHA: ef5b7a73a2ee131bd78793777739dfd9ad4c6856

Review findings:

  • No blocking findings remain.
  • Independent reviewer note: a targeted shared-clone propagation test for AgentProposals would strengthen coverage, but this is not blocking for gator.

Docs: Not needed because this is an internal code refactor with no direct user-facing UX, CLI, policy syntax, provider setup, or published API behavior change.

E2E: test:e2e is already applied because this touches sandbox/network supervisor policy enforcement paths. The current checks are waiting for the copy-pr mirror, and maintainer authority is available to unblock it.

Next state: gator:watch-pipeline

@elezar elezar added gator:watch-pipeline Gator is monitoring PR CI/CD status and removed gator:blocked Gator is blocked by process or repository gates labels Jul 23, 2026
@elezar

elezar commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

/ok to test ef5b7a7

@elezar elezar added gator:in-review Gator is reviewing or awaiting PR review feedback and removed gator:watch-pipeline Gator is monitoring PR CI/CD status labels Jul 23, 2026
SDAChess
SDAChess previously approved these changes Jul 23, 2026

@SDAChess SDAChess left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's merge once the lint passes.

@elezar elezar left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

PR Review Status

Validation: This maintainer-authored refactor is project-valid for OpenShell because it is concentrated in the sandbox/supervisor policy-proposal state path and removes test coupling on a process-global Cargo feature.
Head SHA: 1a57470709fc744b7b8e409fec1697a0cf3fff8e

I rechecked the latest head after @elezar pushed the clippy cleanup and after @SDAChess noted the prior SHA looked good pending lint. The current combined-supervisor path still looks sound, but the sidecar topology has one remaining proposal-state propagation issue.

Review findings:

  • One warning is inline below for sidecar proposal-state propagation.
  • Non-blocking suggestion: add a lifecycle test proving cloned AgentProposals state is shared across PolicyLocalContext, L7 deny response context, and the policy poll/process install path.

Docs: Not needed because this is an internal code refactor with no direct user-facing UX, CLI, policy syntax, provider setup, or published API behavior change.

E2E: test:e2e is already applied for sandbox/network supervisor policy enforcement paths; current checks are still pending.

Next state: gator:in-review

Comment thread crates/openshell-sandbox/src/lib.rs Outdated
Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar
elezar force-pushed the refactor-agent-proposals-state branch from 1a57470 to 359a5bb Compare July 23, 2026 15:40

@elezar elezar left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

PR Review Status

Validation: This maintainer-authored refactor is project-valid for OpenShell because it is concentrated in the sandbox/supervisor policy-proposal state path and removes test coupling on a process-global Cargo feature.
Head SHA: 359a5bb51693c6c24837132afbf651b1258c8af9

I rechecked the latest head after @elezar pushed the sidecar proposal-state update. I also accounted for @SDAChess's maintainer note on the earlier SHA that the change looked good pending lint, and this new head has now had an independent code review.

Review findings:

  • No blocking findings remain.
  • The prior sidecar proposal-state propagation finding appears resolved: bootstrap carries agent_proposals_enabled, sidecar updates include AgentProposalsUpdated, and the process-side watcher applies the shared flag and installs skills on false -> true.
  • Non-blocking suggestion: a targeted regression test proving the same AgentProposals state gates both policy.local and L7 deny-body next_steps would strengthen coverage.

Docs: Not needed because this is an internal state-threading refactor with no direct user-facing UX, CLI, policy syntax, provider setup, or published API behavior change.

E2E: test:e2e is already applied for sandbox/network supervisor policy enforcement paths.

Next state: gator:watch-pipeline

@elezar elezar added gator:watch-pipeline Gator is monitoring PR CI/CD status and removed gator:in-review Gator is reviewing or awaiting PR review feedback labels Jul 23, 2026
@elezar

elezar commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

/ok-to-test 359a5bb

@elezar elezar added test:e2e Requires end-to-end coverage and removed test:e2e Requires end-to-end coverage labels Jul 23, 2026
@github-actions

Copy link
Copy Markdown

Label test:e2e applied for 359a5bb. Open the existing run and click Re-run all jobs to execute with the label set. The run will execute the standard E2E suite after building the required gateway and supervisor images once. The matching required CI gate status on this PR will flip green automatically once the run finishes.

@elezar elezar added gator:approval-needed Gator completed review; maintainer approval needed and removed gator:watch-pipeline Gator is monitoring PR CI/CD status labels Jul 23, 2026
Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar
elezar force-pushed the refactor-agent-proposals-state branch from 359a5bb to f7237a7 Compare July 24, 2026 08:07
@SDAChess
SDAChess enabled auto-merge July 24, 2026 08:52
@SDAChess
SDAChess disabled auto-merge July 24, 2026 08:54
@SDAChess
SDAChess enabled auto-merge July 24, 2026 08:54
@SDAChess
SDAChess added this pull request to the merge queue Jul 24, 2026
@elezar

elezar commented Jul 24, 2026

Copy link
Copy Markdown
Member Author

gator-agent

Merge Ready

Gator validation and PR monitoring are complete, and maintainer approval is present.

Head SHA: f7237a75fa540ca6bdb288a16d4c52166bbfe7ae

Validation: This maintainer-authored refactor is project-valid for OpenShell because it is concentrated in the sandbox/supervisor policy-proposal state path and removes test coupling on a process-global Cargo feature.
Review: The independent reviewer rechecked the current head and found no blocking findings or material regressions. The prior sidecar proposal-state propagation concern remains resolved.
Approval: @SDAChess approved the current head on July 24, 2026; I confirmed the approval applies to f7237a75fa540ca6bdb288a16d4c52166bbfe7ae.
Docs: Not needed because this is an internal state-threading refactor with no direct user-facing UX, CLI, policy syntax, provider setup, or published API behavior change.
Checks: Required gates are green: OpenShell / Branch Checks, OpenShell / Helm Lint, and OpenShell / E2E.
E2E: test:e2e is applied and the core E2E gate is passing. GPU E2E is not required because test:e2e-gpu is not applied.

Human maintainer merge or close decision is now required.

@elezar elezar added gator:merge-ready and removed gator:approval-needed Gator completed review; maintainer approval needed labels Jul 24, 2026
Merged via the queue into main with commit 21da343 Jul 24, 2026
53 of 54 checks passed
@SDAChess
SDAChess deleted the refactor-agent-proposals-state branch July 24, 2026 09:30
@elezar

elezar commented Jul 24, 2026

Copy link
Copy Markdown
Member Author

gator-agent

Monitoring Complete

Monitoring is complete because this PR has merged.

Final status: The last gator state was gator:merge-ready for head f7237a75fa540ca6bdb288a16d4c52166bbfe7ae. Required gates were green, test:e2e was applied and passing, maintainer approval was present, and the PR was merged on July 24, 2026.

I removed the active gator:* label because there is nothing left for gator to monitor on this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants